﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using ImapX.Parsing.Tokens;

namespace ImapX.Parsing.DataItems
{
    public class Envelope : DataItem
    {
        private NString _date = new NString();
        public NString Date { get { return _date; } }

        private NString _subject = new NString();
        public NString Subject { get { return _subject; } }

        private NList<Address> _from = new NList<Address>();
        public NList<Address> From { get { return _from; } }

        public readonly NList<Address> Sender = new NList<Address>();
        public readonly NList<Address> ReplyTo = new NList<Address>();
        public readonly NList<Address> To = new NList<Address>();
        public readonly NList<Address> CC = new NList<Address>();
        public readonly NList<Address> BCC= new NList<Address>();

        public readonly NString InReplyTo = new NString();
        public readonly NString MessageID = new NString();

        public Envelope() : this(false) { }

        public Envelope(bool canBeNIL = false)
            : base(canBeNIL)
        {
            parts = new Token[] { Date, Subject, From, Sender, ReplyTo, To, CC, BCC, InReplyTo, MessageID };
        }

        override public string Command { get { return "ENVELOPE"; } }
    }
}
